﻿using System;

namespace Daco.Web
{
    public class CMessageBox
    {
        public static void Show(System.Web.UI.Page page, string message)
        {

            page.ClientScript.RegisterHiddenField("ctrlMessage", message);

            string scriptBlock = @"
                    $(document).ready(function(){
                        var $dialog = $('<div></div>');
                        
                        $dialog.html($('#ctrlMessage').val());
                        $dialog.dialog({    
                                title: 'Thông báo',
                                autoOpen: true
                            });
                    });
                ";
            page.ClientScript.RegisterStartupScript(page.GetType(), "SystemMessage", scriptBlock, true);
        }
    }
}
